<meta charset="utf-8">
<div style="width:100%" id='reservaView'>
            <?php
            foreach ($reservas as $row){
                $this->table->set_heading('ID','Usuário','Título', 'Descrição','Status',
                            'Inicio','Fim','Agendamento','Aprovação','Aprova','Exclui'
                );
                $dtreserva = $row->dtreserva != NULL ? $dtreserva = date('d/m/Y',(strtotime($row->dtreserva))) : "Aguardando Aprovação";
                if($row->dtreserva != NULL){
                    $acao = "reserva/liberaAdmin/$row->idreserva";
                }
                else{
                    $acao = "reserva/aprovaAdmin/$row->idreserva";
                }
                $aprovacao = $row->dtreserva != NULL ? $aprovacao = "<img src=".base_url()."img/icons/dislike_16x16.png>"
                        : "<img src=".base_url()."img/icons/like_16x16.png>";                
                $this->table->add_row($row->usuario_idusuario, $row->login, $row->title, 
                    $row->descricao_reserva, $row->descricao_status, date('d/m/Y',(strtotime($row->dtinicial))), date('d/m/Y',(strtotime($row->dtfinal))), 
                    date('d/m/Y',(strtotime($row->dtagendamento))), $dtreserva,                       
                    anchor($acao,$aprovacao),
                    anchor("reserva/excluiAdmin/$row->idreserva","<img src=".base_url()."img/icons/delete_16x16.png>", array('id'=>'exclui', 'value'=>$row->idreserva))
                ); 
            }
            $tmpl = array ( 'table_open'  => '<table class="display" id="treserva">' );
            $this->table->set_template($tmpl);
            echo $this->table->generate();
            ?>
</div>